
import request from '@/utils/request'
import type {getTrademarkListResponse,TrademarkItem,TrademarkList} from './model/trademarkModel'

enum Api{
  TrademarkListUrl='/admin/product/baseTrademark',
  saveTrademarkUrl = "/admin/product/baseTrademark/save",
  updateTrademarkUrl = "/admin/product/baseTrademark/update",
  removeTrademarkUrl = "/admin/product/baseTrademark/remove",
  getAllTrademarkListUrl = "/admin/product/baseTrademark/getTrademarkList",
}

export const getTrademarkListApi=(page:number,limit:number)=>{
return  request.get<any,getTrademarkListResponse>(`${Api.TrademarkListUrl}/${page}/${limit}`)
}

export const saveTrademarkApi=(tmName:string,logoUrl:string)=>{
return request.post<any,null>(Api.saveTrademarkUrl,{tmName,logoUrl})
}

export const updateTrademarkApi=(trademark: TrademarkItem)=>{
  return request.put<any,null>(Api.updateTrademarkUrl,trademark)
}
export const removeTrademarkApi=(id:number)=>{
return request.delete<any,null>(Api.removeTrademarkUrl+`/${id}`)
}
//获取所有品牌列表数据
export const getAllTrademarkListApi = () => {
  return request.get<any, TrademarkList>(Api.getAllTrademarkListUrl);
};